﻿Public Class AddRectangleOperation
    Inherits ImageOperationBase
    Private _color As Color
    Private _rect As Rectangle
    Public Sub New(ByVal color As Color, ByVal Rectangle As Rectangle)
        _color = color
        _rect = Rectangle
    End Sub
    Public Overrides Sub ExecuteExtension(ByRef g As System.Drawing.Graphics, ByRef b As Bitmap)
        Dim newbmp As Bitmap = New Bitmap(b.Width, b.Height + _rect.Height)
        g = Graphics.FromImage(newbmp)
        g.DrawImage(b, 0, 0)
        g.FillRectangle(New SolidBrush(_color), New Rectangle(_rect.X, _rect.Y + b.Height, _rect.Width, _rect.Height))
        b = newbmp
    End Sub
End Class